# Contributor: Elizabeth Jennifer Myers <elizabeth@sporksirc.net>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=py3-eventlet
pkgver=0.36.1
pkgrel=0
pkgdesc="Python library for seamless coroutine-based concurrency"
url="https://eventlet.net/"
# riscv: tests fails
arch="noarch !riscv64"
license="MIT"
depends="
	py3-dnspython
	py3-greenlet
	py3-httplib2
	py3-openssl
	py3-psycopg2
	py3-six
	python3
	"
makedepends="py3-hatchling py3-gpep517 py3-wheel py3-hatch-vcs"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/e/eventlet/eventlet-$pkgver.tar.gz"

builddir="$srcdir"/eventlet-$pkgver

# secfixes:
#   0.32.0-r0:
#     - CVE-2021-21419

build() {
	export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	gpep517 install-wheel --destdir .testenv --prefix '' .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	gpep517 install-wheel --destdir "$pkgdir" \
		.dist/*.whl
}

sha512sums="
a13565588c570b8d57b7a8dc3c496e9d95fb3c5a8ce2c60560e532370522b852297cc5bfc7cb3ed80de7a6dca39f15effaf6b1b5498bd910ef278788cb7bc7bd  eventlet-0.36.1.tar.gz
"
